package com.zjs;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.metrics.CounterService;
import org.springframework.stereotype.Component;

@Component
public class GreetingService {
	
	@Autowired
	CounterService counterService;
	
	@Value("${greeting}")
	String greeting;
	
	public String getGreeting(){
		counterService.increment("counter.service.greeting.invoked");
		return greeting;
	}
}
